package com.chocho.producerserver.dao;

import com.chocho.producerserver.bean.Role;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by chocho on 2022/3/29.
 */
@Mapper
@Repository
public interface RolemoduleDao {


    @Select("SELECT moduleId FROM op_role_module " +
            "LEFT JOIN op_role ON op_role.role_id = op_role_module.role_id " +
            "WHERE op_role.role_id = #{roleid}")
    List<String> selectByRoles(String roleid);

    @Delete("DELETE FROM op_role_module WHERE role_id = #{id}")
    Integer deleteByRoleID(String id);

}
